﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyAlbum.Model;

namespace MyAlbum.Services
{
    public interface IEntryService : IDataService<Entry>
    {
        int CountItems();
        /// <summary>
        /// Load the visible entries with the specified album id
        /// </summary>
        /// <param name="albumId">The album id</param>
        /// <returns>List of Entry</returns>
        List<Entry> GetEntriesByAlbum(string albumId);

        /// <summary>
        /// Load the entries with the specified album id
        ///  for the specified page number
        /// </summary>
        /// <param name="albumId">The album id</param>
        /// <param name="pageNumber">The page index</param>
        /// <param name="count">The number of entries per page</param>
        /// <returns>List of Entry</returns>
        List<Entry> GetEntriesByAlbum(string albumId, int pageNumber, int count);

        /// <summary>
        /// Count the total number of entries
        /// </summary>
        /// <param name="visible">A value indicating whether to count the visible entries only</param>
        /// <returns>The number of entries</returns>
        int GetEntriesCount(bool visible);

        /// <summary>
        /// Load the entries with the specified tag name
        /// </summary>
        /// <param name="tagName">The tag name</param>
        /// <param name="visible">A value indicating whether to get the visible entries only</param>
        /// <returns>List of Entry</returns>
        List<Entry> GetEntriesByTagName(string tagName);


        /// <summary>
        /// Load entries for a page
        /// </summary>
        /// <param name="pageNumber">The page index</param>
        /// <param name="count">The number of entries per page</param>
        /// <param name="visible">A value indicating whether to get the visible entries only</param>
        /// <returns>List of Entry</returns>
        List<Entry> GetItems(int pageNumber, int count);

        /// <summary>
        /// Load the latest entry
        /// </summary>
        /// <param name="visible">A value indicating whether to get the visible entries only</param>
        /// <returns>Entry</returns>
        MyAlbum.Model.Entry GetLatestEntry();

        /// <summary>
        /// Get the count of entrie for each month/year
        /// </summary>
        /// <param name="visible">A value indicating whether to count the visible entries only</param>
        /// <returns>List of MonthSummary</returns>
        List<MonthSummary> GetEntriesByMonthsSummary();

        /// <summary>
        /// Load random visible entries summary (no replies or tags)
        /// </summary>
        /// <param name="count">The max number of entries to load</param>
        /// <returns>List of Entry</returns>
        List<MyAlbum.Model.Entry> LoadRandomEntriesSummary(int count);



        /// <summary>
        /// Load the latest entries
        /// </summary>
        /// <param name="count">The number of entries to load</param>
        /// <returns>List of Entry</returns>
        List<MyAlbum.Model.Entry> GetLastItems(int count);
    }
}
